<script setup lang="ts">
import SellRecordList from './SellRecordList.vue'
import SellRecordSearchPanel from './SellRecordSearchPanel.vue'
import { SellRecordApi } from '@/apis'
import { useTable } from '@/hooks'

defineOptions({
  name: 'SellRecordIndex',
})

const queryForm = ref({})

const {
  tableData,
  loading,
  pagination,
  search,
} = useTable(pagination => SellRecordApi.getPage({ ...queryForm.value, ...pagination }))

const onSearch = async (query) => {
  queryForm.value = query
  search()
}
</script>

<template>
  <ProPage title="顾问业绩明细">
    <SellRecordSearchPanel @search="onSearch" />
    <SellRecordList :records="tableData" :loading="loading" :pagination="pagination" />
  </ProPage>
</template>

<style scoped>

</style>
